package com.ikas.ai.server.config.handler;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MapVListStringHandler extends JacksonTypeHandler {

    public MapVListStringHandler(Class<?> type) {
        super(type);
    }


    @Override
    protected Map<String, List<String>> parse(String json) {
        try {
            return JSONObject.parseObject(json, new TypeReference<Map<String, List<String>>>(){});
        } catch (Exception e) {
            return new HashMap<>();
        }
    }
}
